﻿using System;
using System.ServiceModel;
using System.ServiceModel.Activation;
using CoreComponents;
using Crowler.Model.CoreComponents;

namespace Crowler.Dispatcher.Api.Di
{
    public class MyServiceHostFactory : ServiceHostFactory
    {
        protected override ServiceHost CreateServiceHost(
                                              Type serviceType, Uri[] baseAddresses)
            {
                var dependency =  AppEnvironment.GetResolver().Get<IAppEnvironment>();
                return new MyServiceHost(dependency as IAppEnvironment, serviceType, baseAddresses);
            }
    }
}
